<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:DentalGUIHelper="clr-namespace:DentalGUIHelper;assembly=DentalConfig"
  xmlns:dentalConverters="clr-namespace:DentalConfig.Converters;assembly=DentalConfig">

  <dentalConverters:IsStringNullOrEmptyConverter x:Key="StringNullOrEmpty"/>

  <Style x:Key="MaterialDesignTouchScreenButton" TargetType="{x:Type DentalGUIHelper:TouchScreenButton}">
    <Setter Property="Width" Value="264"/>
    <Setter Property="Height" Value="72"/>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type DentalGUIHelper:TouchScreenButton}">
          <Grid>
            <Button x:Name="ContentButton" Style="{DynamicResource MaterialDesignRaisedLightButton}" HorizontalContentAlignment="Center" Padding="0,4,0,0" Margin="4">
              <StackPanel VerticalAlignment="Center">
                <TextBlock x:Name="TopTextBlock" Text="{TemplateBinding TopText}" FontSize="28" TextAlignment="Center"/>
                <TextBlock x:Name="BottomTextBlock" Text="{TemplateBinding BottomText}" FontSize="16" FontFamily="{DynamicResource BoldFontFamily}" TextAlignment="Center"/>
              </StackPanel>
            </Button>
          </Grid>
          <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding Path=TopText, RelativeSource={RelativeSource Self}, Converter={StaticResource StringNullOrEmpty}}" Value="True">
              <Setter TargetName="TopTextBlock" Property="Visibility" Value="Collapsed"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Path=BottomText, RelativeSource={RelativeSource Self}, Converter={StaticResource StringNullOrEmpty}}" Value="True">
              <Setter TargetName="BottomTextBlock" Property="Visibility" Value="Collapsed"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource Self}}" Value="True">
              <Setter TargetName="ContentButton" Property="Style" Value="{DynamicResource MaterialDesignRaisedAccentButton}"/>
            </DataTrigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

  <Style TargetType="{x:Type DentalGUIHelper:TouchScreenButton}" BasedOn="{StaticResource MaterialDesignTouchScreenButton}"/>
</ResourceDictionary>
